/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yandexfotkibackup;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 *
 * @author petr
 */
public class GuiAlbomsData {
    private StringProperty idAlbom;
    private StringProperty nameAlbom;
    private StringProperty countPhoto;
    private BooleanProperty sipping;
    private GuiEventsManager guiManager;
    private AlbomInfo albomInfo;
    private SimpleDoubleProperty progressDownload;

    protected GuiAlbomsData(GuiEventsManager guiManager, AlbomInfo info) {
        albomInfo = info;
        this.idAlbom = new SimpleStringProperty(String.valueOf(info.getId()));
        this.nameAlbom = new SimpleStringProperty(info.getTitle());
        this.countPhoto = new SimpleStringProperty(String.valueOf(info.getCountPhoto()));
        sipping = new SimpleBooleanProperty(false);
        this.guiManager = guiManager;
        //double value = (double)info.getCountPhoto() / 100;
        progressDownload = new SimpleDoubleProperty(0);
        //this.progressDownload.set(value);
    }
    public BooleanProperty shipAlbomProperty() {
        return sipping;
    }
    public StringProperty idAlbomProperty() {
        return idAlbom;
    }

    public StringProperty nameAlbomProperty() {
        return nameAlbom;
    }

    public StringProperty countPhotoProperty() {
        return countPhoto;
    }
    
    public SimpleDoubleProperty progressDownloadProperty() {
        return progressDownload;
    }
    public void setProgressDownload(double value) {
       this.progressDownload.set(value);
    }
    /**
     * @param countPhoto the countPhoto to set
     */
    public void setCountPhoto(StringProperty countPhoto) {
        this.countPhoto = countPhoto;
    }

    void download() {
        guiManager.onDownloadAlbom(getAlbomInfo());
    }

    /**
     * @return the albomInfo
     */
    public AlbomInfo getAlbomInfo() {
        return albomInfo;
    }

    /**
     * @param albomInfo the albomInfo to set
     */
    public void setAlbomInfo(AlbomInfo albomInfo) {
        this.albomInfo = albomInfo;
    }
    
}
